Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

druxt-views

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

druxt-views

Drupal Views components for Druxt with support for filters, pagination and sorting.

  • 0.12.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
190
decreased by-24%
Maintainers
1
Weekly downloads
 
Created
Source

DruxtViews

npm CircleCI Known Vulnerabilities codecov

Drupal Views components for Druxt with support for filters, pagination and sorting.

Install

$ npm install druxt-views

Nuxt.js

Add module to nuxt.config.js

module.exports = {
  modules: [
    'druxt-views'
  ],
  druxt: {
    baseUrl: 'https://demo-api.druxtjs.org',
    views: {
      bundleFilter: true,
      fields: ['title'],
    },
  },
}

Usage

DruxtView component

The DruxtView component uses the JSON:API Views module to render a Decoupled Drupal View.

<DruxtView view-id="frontpage" />

The View can be themed by providing a default scoped slot:

<DruxtView view-id="frontpage">
  <template #default="{ results }">
    {{ results }}
  </template>
</DruxtView>

The component also provides a DruxtWrapper component for theming:

<template>
  <div>
    <slot name="sorts" />
    <slot name="results" />
    <slot name="pager" />
  <div>
</template>

See the DruxtViews API documentation for more information.

Options

Druxt Views options

These options are specific to this module.

OptionTypeRequiredDefaultDescription
views.query.bundleFilterbooleanNofalseWhether to automatically detect Resource types to filter, based on the View bundle filter.
views.query.fieldsstring[]No[]An array of fields to filter from the JSON:API Views Resource types.
views.query.resourceTypesstring[]No[]An array of Resource types to be used by the Fields filter.

Base Druxt options

These options are available to all Druxt modules.

OptionTypeRequiredDefaultDescription
axiosobjectNo{}Axios instance settings.
baseUrlstringYesnullBase URL for the Drupal installation.

Keywords

FAQs

Package last updated on 14 Sep 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc